<template>
  <div>
    <mt-swipe :auto="4000">
        <mt-swipe-item v-for='(item,i) in list' :key="i">
          <img :src="basUrl + item.img"/>
         
        </mt-swipe-item>

    </mt-swipe>
  </div>
</template>

<script>

//6. 导入配置项
import config from '../../js/config.js'

//当前组件的实例
export default {

  data(){
    return {
      basUrl:config.baseUrl,
      list:[
        'http://www.itcast.cn/images/slidead/BEIJING/2017440109442800.jpg',
        'http://www.itcast.cn/images/slidead/BEIJING/2017511009514700.jpg',
        'http://www.itcast.cn/images/slidead/BEIJING/2017421414422600.jpg'
        ]
    }
  },
  created(){
    this.getLuoboList();
  },
  methods:{
    getLuoboList(){
      var url = 'api/getlunbo'; //前面不要加/
      this.$http.get(url).then(res=>{
        var result = res.body;
        if(result.status===0){
          console.log(result.message);
          this.list = result.message;
        }else{
           console.log('失败');
        }
      })
    }
  }
}
  
</script>

<style lang="scss" scoped>

.mint-swipe{
  height:230px;
  .mint-swipe-item:nth-child(3){
    background:red;
  }
  .mint-swipe-item:nth-child(1){
    background:green;
  }
  .mint-swipe-item:nth-child(2){
    background:yellow;
  }
  .mint-swipe-item img{
      width:100%;
      height:100%;
    }
}


  
</style>